<?php


/* @var $model \app\models\Post */
/* @var $vod_list */
/* @var $this \yii\web\View */

use app\helpers\AppHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\Url;


$default_video_url = $vod_list[0]['name'];

?>

<div class="player-container mb-2">
    <div class="player-thumbnail" style="background: url('<?= AppHelper::formatImage($model['thumbnail']); ?>')fixed top;background-size: cover;">
    </div>

    <div class="columns">
        <div class="column col-7 col-lg-12 col-mx-auto">
            <div class="player" id="player">
                <?php if(!empty($vod_list)): ?>
                <iframe src="<?= $default_video_url; ?>" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>

<div class="container">
    <div class="play-server text-center py-2">
    <?php if(!empty($vod_list)): ?>
        <?php foreach ($vod_list as $i => $item): ?>
        <button href="<?= $item['name']; ?>" class="btn<?= $item['name'] == $default_video_url ? ' active' : ''; ?>">分流<?= AppHelper::getPlayName($i); ?></button>
        <?php endforeach; ?>
    <?php endif; ?>

    </div>
    <div class="columns py-2">
        <div class="column col-8 col-md-12">
            <div class="columns">
                <div class="column col-12">
                    <div class="card video-meta">
                        <div class="card-body">
                            <h5><?= $model->title; ?></h5>
                            <div class="post-meta">
                                <a class="btn btn-facebook tooltip" href="javascript:;" data-tooltip="观看">
                                    <i class="iconfont icon-view"><span>100,00</span></i>
                                </a>
                                <a class="favorite btn btn-google tooltip" href="javascript:;" data-tooltip="收藏">
                                    <i class="iconfont icon-like"><span>0</span></i>
                                </a>
                                <a class="ding btn btn-telegram tooltip" href="javascript:;" data-tooltip="顶">
                                    <i class="iconfont icon-ding"><span>3万</span></i></a>
                                <a class="cai btn btn-gray tooltip" href="javascript:;" data-tooltip="踩">
                                    <i class="iconfont icon-cai"><span>746</span></i></a>
                                <a class="download btn btn-pinterest tooltip" href="javascript:;" data-tooltip="下载">
                                    <i class="iconfont icon-download"><span>下载</span></i></a>
                            </div>
                            <div class="divider"></div>
                            <?php if(!empty($model->tags)): ?>
                                <div class="tags">
                                    <i class="iconfont icon-tag"></i>
                                    <?= AppHelper::formatTag($model->tags,$model->type); ?>
                                </div>
                                <div class="divider"></div>
                            <?php endif; ?>

                            <div class="share">
                                <?= \app\widgets\ShareWidget::widget(['title' => $model->title]); ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column col-12">
                    <div class="ad">

                    </div>
                </div>
                <div class="column col-12">
                    <?= \app\widgets\PostRelatedWidget::widget(['cid' => $model->cid]); ?>
                </div>
            </div>
        </div>
        <div class="column col-4 col-md-12">
            <div class="columns">
                <div class="column col-12">
                    <div class="ad">
                        <script type="text/javascript">
                            var ad_idzone = "3006278",
                                ad_width = "250",
                                ad_height = "250";
                        </script>
                        <script type="text/javascript" src="https://ads.exosrv.com/ads.js"></script>
                        <noscript><a href="https://main.exosrv.com/img-click.php?idzone=3006278" target="_blank"><img src="https://syndication.exosrv.com/ads-iframe-display.php?idzone=3006278&output=img&type=250x250" width="250" height="250"></a></noscript>
                    </div>
                </div>
                <div class="column col-12">

                </div>
            </div>
        </div>
    </div>
</div>
